import Vue from 'vue'
import vueRouter from 'vue-router'

Vue.use(vueRouter)
    // import layout from '../../components/index/layout.vue'
    // const layout as resolve => require(['../../components/index/layout.vue'], resolve)

export default new vueRouter({
    // 这个特殊的 `require` 语法将会告诉 webpack
    // 自动将你的构建代码切割成多个包，这些包
    // 会通过 Ajax 请求加载
    mode: 'history',
    routes: [{
        path: '/',
        name: 'layout',
        component: resolve => require(['../../components/index/layout.vue'], resolve),
        // component: '../../components/index/layout.vue',
    }, {
        path: '/login',
        name: 'login',
        component: resolve => require(['../../components/index/login.vue'], resolve),
        // component: '../../components/index/layout.vue',
    }],
})